package com.freestyle.sentinel;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * Created by rocklee on 2022/3/28 17:57
 */
@Data
public class ThrowableEx extends Throwable {
  private MethodArgs methodArgs;
  private Throwable orgThrowable;
  public ThrowableEx(Throwable ex, MethodArgs methodArgs){
    super(ex.getMessage());
    this.orgThrowable=ex;
    BeanUtils.copyProperties(ex,this);
    this.methodArgs=methodArgs;
  }

  public ThrowableEx() {
  }

  public ThrowableEx(String message) {
    super(message);
  }

  public ThrowableEx(String message, Throwable cause) {
    super(message, cause);
  }

  public ThrowableEx(Throwable cause) {
    super(cause);
  }

  public ThrowableEx(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
    super(message, cause, enableSuppression, writableStackTrace);
  }
}
